package org.example.basic;

import lombok.Data;

@Data
public class Edge implements Comparable<Edge>{

    private Integer u;

    private Integer v;

    // 支持度
    private Integer sup;

    // trussness
    private Integer trussness;

    public Edge(){}

    public Edge(int u,int v){
        this.u=u;
        this.v=v;
    }

    public Edge(int u,int v,int sup){
        this.u=u;
        this.v=v;
        this.sup=sup;
    }

    public Edge(int u,int v,int sup,int trussness){
        this.u=u;
        this.v=v;
        this.sup=sup;
        this.trussness=trussness;
    }

    public void increaseSup(){
        setSup(getSup()+1);
    }

    public void decreaseSup(){
        setSup(getSup()-1);
    }

    @Override
    public int compareTo(Edge o) {
        return this.sup.compareTo(o.sup);
    }
}
